\section{MAIN RESULTS}

%\subsection{LOAD CELL NATURAL DYNAMIC RESPONSE}

% To ensure that the thrust data obtained from the dynamic tests are reliable, its necessary to make sure that was no interference of the load cell dynamic response. It was performed a dynamic test with the engine mounted and stopped. A mass of approximately 0,9 kg was put into the same device used to calibrate the load cell. The data acquisition was initiated and the wire connecting the device to the engine was suddenly cut. Using the acquired thrust signal and assuming the load cell behaves like a \textbf{BLA}beam (viga em flexao) (2nd order), it was possible to estimate its transfer function. The resonance frequency obtained was 22 Hz, considerably high and distant from the highest frequency applied in the dynamic tests conducted.

% \begin{figure}[h!]
% \centering
% \includegraphics[angle=0, scale=1]{graf_ressonancia.jpg}
% \caption{Resposta dinâmica da célula de carga.}
% \label{ressonancia}
% \end{figure}

\subsection{Steady state results}

Figure \ref{fig:res_calib} shows the relationships between the PWM signal width sent to the servo and the corresponding thrust and rotation values, from idle to maximum thrust. The error bars represent a confidence level of 95\% ($\pm$2$\sigma$).

\begin{figure}[h!]
\centering
\includegraphics[angle=0, width=0.8\textwidth]{figura_calibracao2.pdf}
\caption{Calibration of steady state values.}
\label{fig:res_calib}
\end{figure}

The RPM signal response was significantly more linear than the thrust signal. So, it was defined that the engine transfer function to be obtained would relate throttle lever angle to the engine's RPM. Above 11000 RPM and below 7000 RPM, some non-linearities were observed. Therefore, the range of servo amplitude for the dynamic tests was defined also: between 7000 and 11000 RPM, for a design point of operation at 9000 RPM.

\subsection{Square wave and sinusoidal frequency sweep results}

The square wave results are presented in figure \ref{fig:ens_square}.  The RPM signal behaves differently depending on whether the engine is being accelerated or deccelerated. In addition, the dynamic response does not repeat itself exactly at each cycle: when the RPM is rising, the steady state value for the RPM is achieved on a slightly different way at every cycle. This unpredictable behavior introduces more error into the parameter estimation. Hence, it becomes interesting to perform a sinusoidal frequency sweep, intending to compare both results.

In figure \ref{fig:ens_sweep}, the command sinusoidal frequency sweep signal (in terms of PWM signal width) and the response (in terms of variation in RPM) are plotted along time. For higher frequencies, it can be clearly seen an increase in the attenuation of the RPM response.

Once the servo motor model is known, it is possible to compare the engine dynamics obtained from the square wave signal and the sinusoidal frequency sweep signal.

\subsection{Servo actuator model estimation} \label{sec:identification}

In figure \ref{fig:ens_servo}, the command square wave signal (in terms of variation of PWM width) and the actual servo position (in degrees) are plotted along time.

\begin{figure}[h!]
  \centering
  \subfloat[Servo experimental step response.]{\label{fig:ens_servo}\includegraphics[width=0.9\textwidth]{ensaio_servo.pdf}}     \\           
  \subfloat[Comparison between indentified model and experimental data.]{\label{fig:mod_servo}\includegraphics[width=0.9\textwidth]{mod_servo.pdf}}
  \caption{Servo model identification.}
  \label{fig:res_servo}
\end{figure}

In \cite{BRENAN97}, system identification is performed on servos used for RC vehicles. The servos were modeled as a rate-limited second order system. A typical model for a commercial servo motor dynamics is presented in figure \ref{fig:db_servo}. Three variables are required to define completely the servo model: gain, pole and saturation.

\begin{figure}[h!]
\centering
\includegraphics[angle=0, width =0.9\textwidth]{modelo_servo.pdf}
\caption{Typical dynamic model for a commercial servo with the identified parameters for this work case.}
\label{fig:db_servo}
\end{figure}

Using LabView Systems Identification Toolkit, it was possible to create a user-defined model just like the servo model presented in figure \ref{fig:db_servo}. The servo model block diagram created in LabView is shown in figure \ref{fig:vi_servo_model}.

\begin{figure}[h!]
\centering
\includegraphics[angle=0, width =\textwidth]{diagrama_blocos_servo.pdf}
\caption{User-defined model for the servo created in LabView environment.}
\label{fig:vi_servo_model}
\end{figure}

With the input and output signals, it was possible to use the LabView's VI SI Estimate User-Defined Model, which employs a Gauss-Newton algorithm to minimize the error between the predicted model output and the measured one by changing the guessed tranfer function coeffients. The parameters the best fit the experimental data are those already presented in figure \ref{fig:db_servo}.

Simulating the input signal with the optimized model and comparing the response with the experimental output signal (figure \ref{fig:mod_servo}), it can be seen that there is good correspondence bewteen the identified model and experimental data.

\subsection{Engine model estimation}\label{sec:Engine_model_estimation}

Proceeding as explained in section \ref{sec:identification}~, after estimating the servo motor model parameters, the engine model was identified. Initially, a first-order model was considered. After estimating the best coefficients, the model was simulated and superimposed with the actual engine response. The first order models estimated with the square wave signal and the sinusoidal frequency sweep signal are presented in the figures \ref{fig:mod_square} and \ref{fig:mod_sweep}, respectively. 

\begin{figure}[h!]
  \centering
  \subfloat[Engine response to square wave signal.]{\label{fig:ens_square}\includegraphics[width=0.9\textwidth]{ensaio_step.pdf}} \\               
  \subfloat[Comparison between indentified model and experimental data: The square wave response]{\label{fig:mod_square}\includegraphics[width=0.9\textwidth]{modelo_step.pdf}}
  \caption{Engine model identification: The step response case.}
  \label{fig:res_step}
\end{figure}

\begin{figure}[h!]
  \centering
  \subfloat[Engine response to sinusoidal frequency sweep signal.]{\label{fig:ens_sweep}\includegraphics[width=0.9\textwidth]{ensaio_sweep.pdf}} \\          
  \subfloat[Comparison between indentified model and experimental data: The sweep response]{\label{fig:mod_sweep}\includegraphics[width=0.9\textwidth]{modelo_sweep.pdf}}
  \caption{Engine model identification: The sinusoidal sweep case.}
  \label{fig:res_sweep}
\end{figure}

% inserir uma tabela comparando as duas FT de 1st order (step e sweep)
\begin{table}[!h]
\centering
\caption{Parameter estimation results for sinusoidal frequency sweep and square wave data.}
\begin{tabular}{cccc}\toprule
1st-order Transfer Function & Square wave model & Frequency sweep model & Average model\\
\midrule
Numerator & 549.2 & 552.7 & 550\\
\midrule
Denominator & s + 4.08 & s + 3.90 & s + 4.0\\
\bottomrule
\end{tabular}
\label{tab:table_1}
\end{table}

Table \ref{tab:table_1} shows that the estimated parameters from both models are considerably similar. In order to define a  1st-order model to compare with the experimental data in figures \ref{fig:mod_square} and \ref{fig:mod_sweep}, an average value for the parameters was considered.

\subsection{Engine model validation}

After estimating the engine model parameters, it is necessary to accomplish another step, usually called ``model validation''. In most cases, it's possible to find more than one model structure that seem to adequately fit experimental data. So, the main challenge is how to decide which model is the best one. 


In the previous section, it was presented the 1st-order transfer function obtained for the engine. It was seen that both parameter estimation processes carried out from sinusoidal frequency sweep data and from square wave data lead to the same model, but there are no guarantees that this is the best model. Increasing the order of the transfer function usually improves the match between model and experimental data. On the other hand, a more complex model can incorporate errors due to incompatibilities with the actual process being modeled. According to \cite{Ravindra}, if different models can fit the experimental data within specific tolerances, than the best model is that with the minimum number of parameters.

The whole parameter estimation process was repeated for a second-order transfer function model, in order to check if a higher order model would significantly improve the match. This process was performed with the sinusoidal frequency sweep data and square wave data. The input signals were simulated in this 2nd-order model and the output results were compared with those previously obtained by the 1st-order model, as shown in figure \ref{fig:validation}.

%validacao_modelo_step.pdf
%validacao_modelo_sweep.pdf

\begin{figure}[h!]
  \centering
  \subfloat[Comparison between 1st-order and 2nd-order estimated models.]{\label{fig:val_sweep}\includegraphics[width=0.9\textwidth]{validacao_modelo_sweep.pdf}} \\          
  \subfloat[Comparison between 1st-order and 2nd-order estimated models.]{\label{fig:val_step}\includegraphics[width=0.9\textwidth]{validacao_modelo_step.pdf}}
  \caption{Engine model validation: The sinusoidal sweep and square wave case.}
  \label{fig:validation}
\end{figure}

% inserir uma tabela comparando as duas FT de 1st order (step e sweep)
\begin{table}[!h]
\centering
\caption{2nd-order model obtained from parameter estimation.}
\begin{tabular}{cc}\toprule
2nd-order Transfer Function & Model obtained\\
\midrule
Numerator & 14000\\
\midrule
Denominator &  s$^{2}$ + 102.7s + 24.3\\
\bottomrule
\end{tabular}
%\label{tab1}
\end{table}

\begin{figure}[h!]
\centering
\includegraphics[angle=0, width = 0.8\textwidth]{modelo_servo_e_motor.pdf}
\caption{Final block diagram with identified parameters.}
\label{fig:db_final}
\end{figure}

It can be seen that the results are visually coincident. For the sinusoidal frequency sweep data, the differences are less than 4\%, while the differences in the square wave data are less than 1\%. Therefore, if the match improvement is neglectable, it doesn't seem plausible to develop a more complex model and the first-order transfer function for the engine can be assumed as the best model. The final block diagram with identified parameters is presented in figure \ref{fig:db_final}.


